﻿using UnityEngine;
using System.Collections;
using Spine.Unity;

public class TestSpine : MonoBehaviour {

	private SkeletonAnimation skeletonAnimation;

	// Use this for initialization
	void Start () {
		skeletonAnimation = GetComponent<SkeletonAnimation> ();

		//skeletonAnimation.state.SetAnimation (0, "run", false);
		//skeletonAnimation.state.AddAnimation (0, "shoot", false, 1.0f);

		StartCoroutine (StartAnimation ());
	}
	
	// Update is called once per frame
	void Update () {

	}

	IEnumerator StartAnimation() {
		skeletonAnimation.state.SetAnimation (0, "idle", true);
		yield return new WaitForSeconds (3.0f);
		skeletonAnimation.state.SetAnimation (1, "run", false);
	}
}
